<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html>
<html>
<head>
<title>问题反馈</title>
<jsp:include page="/include.jsp" />
<style type="text/css">
	.main{overflow:hidden;border:3px solid #d9d9d9;margin:20px 0 10px 0;padding:18px 5px 10px;}
	
	.threadlist th,.threadlist td{border-bottom:1px solid #EBEBEB;font-weight:400;text-align:left}
	.threadlist thead.category th,.threadlist thead.category td{background:#EEF4F9;border-bottom:1px solid #D3E0EC;border-top:1px solid #D3E0EC;}
	.folder{width:30px;text-align:center;}
	.icon{padding:3px 0;width:16px;text-align:center;}
	.threadlist .subject{padding:7px 5px;}
	.threadlist td.author,.threadlist .lastpost{width:150px;}
	.threadlist cite{display:block;}
	.lastpost cite,.threadlist .lastpost em{display:block;margin-right:5px;text-align:right;}
	.author em, .threadlist .lastpost em,.threadlist .lastpost em a,.time{font-size: 10px;color:#999;font-family:Arial,sans-serif;}
	
	.forPages{background-color:#EBF2F8;width:100%;height:35px;color:white;padding:5px 0 0 5px }
	.pages{float:right}
	.pages a,.pages span{float:left;overflow:hidden;padding:0 6px;margin-right:2px;border:1px solid;height:24px;line-height:24px;}
	.pages a,.pageback a{border-color:#E6E7E1;background-color:#FFF;color:#09C;}
	.pages a:hover{border-color:#09C;}
	.pages .kbd{color:#09C;background:#FFF;border:1px solid;}
	.pages .currentPage {background-color:#0099CC;color:#FFFFFF}
	
	
	.trColor{ background-color:#DFF6FF}  
	
</style>  
<script type="text/javascript">
	$(function(){
		$(".threadlist tr").mouseover(function(){
			$(this).addClass("trColor");
		});
		$(".threadlist tr").mouseout(function(){
			$(this).removeClass("trColor");
		});
	});
</script> 
</head>
<body> 
   <div class="main">
   <div style="background-color: #ECF9FF; height: 25px">
   		<div style="width: 100%;"><span style="font-weight:bold;"><s:property value="#title" />问题列表</span></div>
   </div>
	<div class="threadlist" style="padding:20px" >
		<table style="width:100%;height:100%;"  id="threadlist" cellspacing="0" cellpadding="0">
			<thead class="category">
				<tr>
					<td class="folder">&nbsp;</td>
					<td class="icon">&nbsp;</td>
					<th>标题</th>
					<td class="author">作者</td>
					<td class="nums">回复/查看</td>
					<td class="lastpost"><cite>最后发表</cite></td>
				</tr>
			</thead>
		  <s:iterator value="plist" id="problem">
			<tbody>
				<tr>
					<td class="folder">
						<!-- <a href="/bbs/showtopic-5498.aspx" target="_blank"><img src="${pageContext.request.contextPath}/images/bbs/t_top3.gif"></a> -->
						&nbsp;	
					</td>
					<td class="icon">
						<s:if test="#problem.indexCount>=10 || #problem.viewCount>=50">
							<img src="${pageContext.request.contextPath}/images/bbs/hot.gif" alt="listicon">
						</s:if>
						<s:else>
							<img src="${pageContext.request.contextPath}/images/bbs/topic.gif" alt="listicon">
						</s:else>
					</td>
					<th class="subject">
							<a href="${pageContext.request.contextPath}/feedbackInfo/proFeedBackInfoAction!toListFreedBack.action?flag=1&problemId=<s:property value='#problem.problemId'/>"><span style="font-weight:bold;"><s:property value="#problem.title"/></span></a>
					</th>
					<td class="author">
						<cite>
							<a href="#"><s:property value="#problem.responsibler"/></a></cite>
						<em><s:property value="#problem.discoveryTime"/></em>
					</td>
					<td class="nums"><em><s:property value="#problem.indexCount"/></em> / <s:property value="#problem.viewCount"/></td>
					<td class="lastpost">
						<cite>
								<a href="#" target="_self"><s:property value="#problem.feedbacker"/></a>
						</cite>
						<em><a href="#"><s:property value="#problem.feedbackTime"/></a></em>
					</td>
				</tr>
			</tbody>
		   </s:iterator>
		</table>
	</div>
	
		<!-- 分页start -->
				<div class="forPages">
				<div class="pages">
					<!-- <a class="kbd" href="www.baidu.com">返回列表</a> -->
					<s:if test="#ppage.page>=5">
						<a href="${pageContext.request.contextPath}/feedbackInfo/proFeedBackInfoAction!toListProblem.action?page=1">«</a>
					</s:if>
					<s:set name="lastPage" value="(#ppage.totals%#ppage.rows==0)?(#ppage.totals/#ppage.rows):(#ppage.totals/#ppage.rows+1)"/>
					<!-- 分页最多显示8页，前后页数会隐藏，下面是判断过程，当前页最少前面保持4页后面保持3页 -->
					<s:if test="#lastPage<=8">
						<s:set name="firstNumber" value="1"/>
						<s:set name="lastNumber" value="#lastPage"/>
					</s:if>
					<s:else>
						<!-- 当前页>=5 同时 当前页<=lastPage-4时候 -->
						<s:if test="#ppage.page>=5 && #ppage.page+4<#lastPage">
							<s:set name="firstNumber" value="#ppage.page-4"/>
							<s:set name="lastNumber" value="#ppage.page+3"/>	   	
						</s:if>
						<!--  当前页>=lastPage-4 时候-->
						<s:elseif test="#ppage.page+4>=#lastPage">
							<s:set name="firstNumber" value="#lastPage-7"/>	
							<s:set name="lastNumber" value="#lastPage"/>
						</s:elseif>
						<!-- 5>当前页>=1 时候 -->
						<s:else>
							<s:set name="firstNumber" value="1"/>
							<s:set name="lastNumber" value="8"/>	
						</s:else>
					</s:else>
					<s:bean name="org.apache.struts2.util.Counter" id="counter">
						   	<s:param name="first" value="%{firstNumber}" />
						    <s:param name="last" value="%{lastNumber}" />
						   <s:iterator id="index">
						   		<s:if test="#index==#ppage.page">
							   		<a class="currentPage" href="${pageContext.request.contextPath}/feedbackInfo/proFeedBackInfoAction!toListProblem.action?page=<s:property value='#index'/>"><s:property value="#index"/></a>
						   		</s:if>
						   		<s:else>
						   			<a href="${pageContext.request.contextPath}/feedbackInfo/proFeedBackInfoAction!toListProblem.action?page=<s:property value='#index'/>"><s:property value="#index"/></a>
						   		</s:else>
						   </s:iterator>
					</s:bean>
					<s:if test="#ppage.page+4<#lastPage">
						<a href="${pageContext.request.contextPath}/feedbackInfo/proFeedBackInfoAction!toListProblem.action?page=<s:property value='%{#lastPage}'/>">»</a>
					</s:if>
					<s:if test="#ppage.totals!=0">
						<s:if test="#lastPage!=#ppage.page">
							<a class="kbd" href="${pageContext.request.contextPath}/feedbackInfo/proFeedBackInfoAction!toListProblem.action?page=<s:property value='#ppage.page+1'/>" class="next">下一页</a>
						</s:if>
						<span class="kbd"><s:property value="#ppage.page"/>/<s:property value="#lastPage"/></span>
					</s:if>
				 </div>
				 </div>
				 <!-- 分页end -->
  </div>
</body>
</html>